package com.md.mapper;

import com.md.entity.Flowers;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface flowerMapper {
    @Select("select * from flowers")
    List<Flowers> selectAll();
    @Select("select * from flowers where flowerId = #{id}")
    Flowers selectOneById(int id);
    @Select("select * from flowers where flowerName like '%${name}%'")
    List<Flowers> selectOneByName(String name);
    @Insert("insert into flowers(flowerName, category, price) VALUES (#{flowerName},#{category},#{price})")
    int insert(Flowers flowers);
    @Delete("delete from flowers where flowerId=#{id}")
    int delete(int id);
    @Update("update flowers set flowerName = #{flowerName},category = #{category},price = #{price} where flowerId = #{flowerId}")
    int update(Flowers flowers);
}
